﻿using Epic.ComponentServices.Converters;
using Epic.Core;
using System;
using System.ComponentModel;
using System.Globalization;

namespace KyuuBackground
{
    class MyEnumConverter : LocalizedEnumConverter
    {
        public MyEnumConverter(Type type)
            : base(typeof(Properties.Resources).GetResourceManager(), type)
        {
        }

        protected override string GetResourceKey(string enumName)
        {
            return string.Format("Enum_{0}_{1}", EnumType.Name, enumName);
        }

        protected override bool ShouldConvertToEnhancedString(ITypeDescriptorContext context, object value, CultureInfo culture)
        {
            return context != null;
        }
    }
}
